#include <cstdio>
#include <cstring>
#include <iostream>
#define ll long long
#define INF 1000000007
#define eps 1e-6
#define mod 1000000007
#define double long double
using namespace std;
ll f[100010];
int main()
{
    // freopen("input.txt","r",stdin);
    int n, k, m;
    ll ans;
    while (cin >> n >> k >> m)
    {
        if (n == 0 && k == 0 && m == 0)
            return 0;
        f[1] = 0;
        for (int i = 2; i <= n; ++i)
        {
            f[i] = (f[i - 1] + k) % i;
        }
        ans = f[n] + 1 + m - k;
        ans %= n;
        if (ans <= 0)
            ans += n;
        cout << ans << endl;
    }

    return 0;
}